﻿using UnityEngine;
using System.Collections;

public class shot : MonoBehaviour
{
	public GameObject bullet;

	public string trigger;

	public GameObject shotposition; 
	public float bulletvel;
	
	void Start() 
	{

	}
	

	void Update() 
	{
		if (Input.GetKeyDown(KeyCode.P))
		{
			GameObject tiro = Instantiate(bullet,shotposition.transform.position,Quaternion.identity) as GameObject; 
			tiro.rigidbody2D.AddForce(new Vector2 (bulletvel,bulletvel));
		}
	}
}